<?php
namespace app\common\model;


abstract class BannerModel extends BasicModel
{
    public $table = null;

    public $_map = [
        'status' => [
            0 => '禁用',
            1 => '正常',
        ],
    ];

    //此处不能使用__construct
    protected function initialize()
    {
        //因操作方法后缀配置未开启，需设置完全表名
        $this->table = config('database.prefix').strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', 'Banner'));

        parent::initialize();
    }
}